<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>TestModel</title>
    <link rel="stylesheet" type="text/css" href="/static/assets/css/bootstrap/css/bootstrap.min.css">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
            integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd"
            crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
    <div><h1>参数列表</h1></div>
   {% comment %} <form class="form-inline" url="{% url 'demo' %}" method="get">
        <div class="form-group input-group">
            <div class="input-group-addon">章节：</div>
            <input type="text" class="form-control" name="q" id="q" placeholder="chapter_id">
            <div class="input-group-btn">
                <button type="submit" class="btn btn-default">搜索</button>
            </div>
        </div>
    </form>{% endcomment %}
  {% comment %}  <div><h2 id="chp_name" value="">{{ chapter }}</h2>
    </div>{% endcomment %}
    <div>
    <button class="btn btn-primary" data-toggle="modal" data-target="#pModal">打开</button>
        {#        {{ list }}<br>#}
       {% comment %} <table class="table table-striped">
            <thead>
            <tr>
                {#                <th></th>#}
                <th>变量名</th>
                <th>值</th>
                <th>计量单位</th>
                {#                <th>所属模块</th>#}
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for item in list %}
                <tr>
                    {#                    <td class="col-lg-2">{{ list }}</td>#}
                    <td class="col-lg-2">{{ item.display_name }}</td>
                    <td class="col-lg-2">{{ item.testvalue__value }}</td>
                    <td class="col-lg-2">{{ item.unit }}</td>
                    {#                    <td class="col-lg-2">{{ item.5 }}</td>#}
                    <td class="col-lg-2">
                        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#pModal"
                                onclick="editpara({{ item|safe }})">编辑
                        </button>
                        {#                        <button type="button" class="btn btn-danger">删除</button>#}
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>{% endcomment %}
    </div>

    <!-- 编辑参数模态框 -->
    <div class="modal fade" id="pModal" tabindex="-1" role="dialog" aria-labelledby="pModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <!-- 模态框头部 -->
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title" id="pModalLabel">编辑变量</h4>
                </div>
                <!-- 模态框主体 -->
                <div class="modal-body">
                    <form role="form" method="post" style="margin-left: 10px; margin-right: 10px">
                        模态框内容
{#                        {% csrf_token %}#}
                     {% comment %}   <input type="hidden" id="paraid" value=""/>
                        <input type="hidden" id="pvalid" value=""/>
                        <input type="hidden" id="projid" value=""/>
                        <div class="form-group">
                            <label for="parameter" class="control-label">变量名:</label>
                            <input type="text" class="form-control" id="parameter" Disabled>
                        </div>
                        <div class="form-group">
                            <label for="value" class="control-label">值:</label>
                            <input type="text" class="form-control" id="value">
                        </div>
                        <div class="form-group">
                            <label for="unit" class="control-label">计量单位:</label>
                            <input type="text" class="form-control" id="unit" Disabled>
                        </div>{% endcomment %}
                    </form>
                </div>
                <!-- 模态框底部 -->
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="savepara" onclick="save()">保存</button>
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
</div>

</body>

</html>